package main

import (
	"gin-list/dao"
	"gin-list/model"
	"gin-list/router"
	_ "github.com/jinzhu/gorm/dialects/mysql"
)

func main() {
	err := dao.InitMySql()
	if err != nil {
		panic(err)
	}
	defer dao.DB.Close()
	//模型绑定
	dao.DB.AutoMigrate(new(model.ToDo))
	//注册路由
	r := router.SetupRouter()
	r.Run()
}
